package com.gxuwz.business.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.gxuwz.business.dao.impl.StudentDAO;
import com.gxuwz.business.entity.Student;
import com.gxuwz.business.service.IStudentService;
import com.gxuwz.util.Pager;

@Service("studentService")
public class StudentServiceImpl implements IStudentService {
	
	@Autowired
	private StudentDAO studentDAO;

	@Override
	public boolean add(Student student) {
		return studentDAO.add(student);
	}

	/**
	 * 只更新学号、姓名、性别、年龄、年级、学院、班别、医保类型、
	 */
	@Override
	public boolean update(Student student) {
		 return studentDAO.update(student);
	}

	@Override
	public boolean delete(Student student) {
		return studentDAO.delete(student);
	}

	/**
	 * 根据挂号编号查找
	 * @param studentId
	 * @return
	 */
	@Override
	public Student findById(Student student) {
		return studentDAO.findById(student);
	}

	@Override
	public List<Student> getAll() {
		// TODO Auto-generated method stub
		return studentDAO.getAll();
	}

	@Override
	public Pager<Student> getByPager(Student student, Integer page, Integer limit) {
		return studentDAO.getByPager(student, page, limit);
	}


	/**
	 * 检测学号是否已存在
	 */
	@Override
	public boolean checkStuId(Student student) {
		return studentDAO.checkStuId(student);
	}

	@Override
	public void updateState(String regId, Integer state) {
		studentDAO.updateState(regId, state);
		
	}

	@Override
	public boolean updates(Student student) {
		return studentDAO.updates(student);
	}

	
	/**
	 * 获取已完成治疗的
	 */
	@Override
	public List<Student> getAllSucceed() {
		return studentDAO.getAllSucceed();
	}

	

}
